﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Andrewl.XnaHelpers.Audio
{
    public class XactAudio
    {
        #region Variable Declarations

        public List<XactSoundManager> xactSoundManagers;

        #endregion

        #region Accessors

        public XactSoundManager this[string name]
        {
            get
            {
                for (int i = 0; i < xactSoundManagers.Count; i++)
                {
                    if (name.Equals(xactSoundManagers[i].name))
                        return xactSoundManagers[i];
                }
                return null;
            }
        }

        public bool IsEmpty
        { get { if (xactSoundManagers.Count > 0) return false; else return true; } }

        #endregion

        public XactAudio()
        {
            xactSoundManagers = new List<XactSoundManager>();
        }

        public void Add(XactSoundManager xactSoundManager)
        {
            xactSoundManagers.Add(xactSoundManager);
        }

        public void Remove(string name)
        {
            for (int i = 0; i < xactSoundManagers.Count; i++)
            {
                if (name.Equals(xactSoundManagers[i].name))
                {
                    xactSoundManagers.Remove(xactSoundManagers[i]);
                    return;
                }
            }
        }

        public void Remove(XactSoundManager xactSoundManager)
        {
            xactSoundManagers.Remove(xactSoundManager);
        }
    }
}
